function $(doc) {
	return document.querySelector(doc)
}

function inputFun(maxNum){
	this.val = 1;
	this.numberId = 'number';
	this.maxNum=maxNum;
}

/**
 * 点击加
 * @param {Object} val
 * @return string
 */
inputFun.prototype.isMaxNum = function(val){
	if(val>=this.maxNum){
		val = this.maxNum
	}
	return val;
}
/**
 * 点击加
 * @param {Object} val
 * @return string
 */
inputFun.prototype.isPluse = function(val){
	val++;
	this.val = this.isMaxNum(val);
	return this
}
/**
 * 点击减
 * @param {Object} val
 * @return string
 */
inputFun.prototype.isReduce = function(val){
	val--;
	if(val<=1){
		val=1
	}
	this.val = val;
	return this
}
/**
 * 输入数字
 * @param {Object} val
 * @return string
 */
inputFun.prototype.keyup = function(val){
	this.val = this.isMaxNum(val);
	return this
}